The present invention relates generally to the field of development systems for computers and, more particularly, to systems and methods for compiling source programs into object modules and linking those modules into programs executable by computers.
Before a digital computer may accomplish a desired task, it must receive an appropriate set of instructions. Executed by the computer's microprocessor, these instructions, collectively referred to as a "computer program," direct the operation of the computer. Expectedly, the computer must understand the instructions which it receives before it may undertake the specified activity.
Owing to their digital nature, computers essentially only understand "machine code," i.e. the low-level, minute instructions for performing specific tasks--the sequence of ones and zeros that are interpreted as specific instructions by the computer's microprocessor. Since machine language or machine code is the only language computers actually understand, all other programming languages represent ways of structuring human language so that humans can get computers to perform specific tasks.
While it is possible for humans to compose meaningful programs in machine code, practically all software development today employs one or more of the available programming languages. The most widely used programming languages are the "high-level" languages, such as C or Pascal. These languages allow data structures and algorithms to be expressed in a style of writing which is easily read and understood by fellow programmers.
A program called a "compiler" translates these instructions into the requisite machine language. In the context of this translation, the program which is written in the high-level language is called the "source code" or source program. Translating human-oriented programming languages into computer-oriented machine languages, compilers allow computer programmers to ignore the machine-dependent details of machine language. Compilers are now fundamental to modern-day application and system software development.
Most compilers are syntax driven, i.e., the compilation process is directed by the syntactic structure of the source program, as recognized by a compiler's parser. The parser builds the structure out of tokens, the lowest-level symbols used to define a programming language's syntax. This recognition of syntactic structure is a major part of the analysis task. Semantic routines actually supply the meaning (semantics) of the program, based on the syntactic structures. The semantic routines generate the target code or, optionally, some intermediate representation thereof.
The ultimate output of the compiler is an "object module". Although an object module includes object code for instructing the operation of a computer, the object module is not in a form which may be directly executed by a computer. Instead, it must undergo a "linking" operation before the final executable program is created.
While linking involves many specific operations, it may be thought of as the general process of combining or linking together one or more compiled object modules to create an executable program. This task usually falls to a "linker." In typical operation, a linker receives, either from the user or from an integrated compiler, a list of object modules desired to be included in the link operation. The object modules themselves may either be stored separately in standalone object or .OBJ files which the compiler has generated, or in "library" or .LIB files which are .OBJ files aggregated into a single file by a "librarian". In operation, the linker scans the object modules from the object and library files specified. After resolving interconnecting references as needed, the linker constructs an executable image by organizing the object code from the modules of the program in a format understood by the operating system program loader.
Without further enhancement, linking incurs substantial processing time and resources for handling object modules in libraries which are ultimately not needed in the link. The data from the modules is read and buffered in memory, and all of the information for these modules is examined and analyzed. All told, the process requires a considerable amount of processing time and resources for determining exactly which object modules are needed in the link. Moreover, a significant amount of internal storage is dedicated to caching information extracted from the object modules.
What is needed is a linker which knows beforehand which object modules are needed. More particularly, if a linker knows before libraries are read which object modules are needed for a link, unnecessary modules may be skipped (i.e., not read) during the link. Both processing time and internal storage requirements for the linking operation may be substantially reduced. Not only would such a linker be faster, but it would also have greater capacity. The present invention fulfills this and other needs.